const baseUrl = "http://www.pudge.wang:4000"

const request = (url, method = "GET", data = {}) => {
  return new Promise((resolve, reject) => {
    wx.request({
      url: baseUrl + url, //仅为示例，并非真实的接口地址
      method,
      data,
      header: {
        'content-type': 'application/json' // 默认值
      },
      success: (res) => {
        resolve(res)
      }
    })
  })
}

module.exports = {
  request
};